#include<bits/stdc++.h>
using namespace std;
char isbn[20];
int main() {
  cin>>isbn;
  int time = 1;
  int checksum = 0;
  for(int i=0; isbn[i]; ++i) {
    if(time == 10) break;
    if(isdigit(isbn[i])) {
      checksum += time *(isbn[i]-'0');
      time++;
    }
  }
  checksum %= 11;
  char expected;
  if(checksum == 10) expected = 'X';
  else expected = checksum + '0';
  if(isbn[12] == expected) puts("Right");
  else {
    isbn[12] = expected;
    puts(isbn);
  }
  return 0;
}
